cmake_minimum_required(VERSION 3.0.0)

project(leetcode LANGUAGES CXX)

set(CMAKE_BUILD_TYPE debug)

add_definitions("-Wall -g")

set(CMAKE_CXX_STANDARD 11)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CXX_FLAGS   "-std=c++11")             # c++11
set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -g")                     # 调试信息
set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -Wall")                  # 开启所有警告

message(CMAKE_CXX_FLAGS ": ${CMAKE_CXX_FLAGS}")

set(CMAKE_CXX_FLAGS_DEBUG   "-O0" )             # 调试包不优化
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG " )   # release包优化


set(INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/leetcode ${CMAKE_CURRENT_LIST_DIR}/interview)
message(INCLUDE_DIRECTORIES ": ${INCLUDE_DIRECTORIES}")

include_directories(${INCLUDE_DIRECTORIES})

include(CTest)
enable_testing()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)
message(EXECUTABLE_OUTPUT_PATH ": ${EXECUTABLE_OUTPUT_PATH}")

add_executable(solver main.cpp)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
